package com.qzsoft.zhjd.materiel.modules.materielconsume.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName MaterielConsumeEntity
 * @Description 材料消耗对象
 * @author linhuawei
 * @since 2022-04-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_materiel_consume")
public class MaterielConsumeEntity {

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 基地编码
     */
    @NotBlank(message = "基地名称不可为空")
    private String baseCode;

    /**
     * 材料主键
     */
    private String materielItemId;

    /**
     * 开始时间
     */
    @NotNull(message = "开始时间不可为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private Date beginTime;

    /**
     * 结束时间
     */
    @NotNull(message = "结束时间不可为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 期初余额
     */
    private BigDecimal beginBalance;

    /**
     * 期末余额
     */
    private BigDecimal endBalance;

    /**
     * 本期收入
     */
    private BigDecimal income;

    /**
     * 本年累计收入
     */
    private BigDecimal incomeYear;

    /**
     * 本期支出
     */
    private BigDecimal expend;

    /**
     * 生产用量
     */
    private BigDecimal prodWeigth;

    /**
     * 计划用量
     */
    private BigDecimal planWeigth;

    /**
     * 添加人
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 添加时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

}
